package top.callname.util;

import org.weixin4j.Configuration;
import org.weixin4j.Weixin;
import org.weixin4j.WeixinException;
import org.weixin4j.model.base.Token;

/**
 * 
 * @ClassName: WeixinUtil
 * @Description: 微信工具类
 */
public final class WeixinUtil {

	private static Weixin weixin = new Weixin();
	
	/**
	 * 获取token
	 * @return
	 */
	public static Token getAccessToken(){
		Token token = null;
		try {
			token = weixin.getToken();
		} catch (WeixinException e) {
			e.printStackTrace();
		}
		return token;
	}
	
	/**
	 * 获取配置文件中的appid
	 * @return
	 */
	public static String getOriginalid(){
		return Configuration.getProperty("weixin4j.oauth.originalid", "gh_54db13f74404");
	}
	
}
